package com.nuonuo.refresh.controller;

import com.nuonuo.middleware.drs.client.annotation.DrsValue;
import com.nuonuo.middleware.drs.spring.context.annotation.DrsBeanRefresh;
import org.springframework.context.annotation.Scope;
import org.springframework.context.annotation.ScopedProxyMode;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.PostConstruct;

/**
 * @author duan
 * @version 1.0
 * @date 2023/1/16 10:41
 */
@RestController
@RequestMapping(value = "drsValue")
@Scope(proxyMode = ScopedProxyMode.TARGET_CLASS)
public class DrsValueController  {

    @DrsValue("${app.name:test-client}")
    private String appName;

    @PostConstruct
    public void init() {
        System.out.println("controller 111 ....");
    }

    @GetMapping(value = "getAppName")
    public String getAppName() {
        return this + ", " + appName;
    }

}
